/***************************************************************************
 创建者: 华磊
 开始时间: 2018.8.14
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) 李文友 2017.5.8 类的具体实现代码编写

 ***************************************************************************/
#include <QDateTime>
#include <QRegExp>
#include <QNetworkInterface>
#include <QNetworkAddressEntry>
#include <QSettings>

#include "XmlParse.h"
#include "md5check.h"
#include "measuretime.h"

#include "powermanagerNew.h"
#include "messagelog.h"
#include "robotcontrol.h"
#include "hmigsoapqt.h"







PowerManager::PowerManager()
{
    currentValidAxisId=-1;

    positionIncrement=0;

}

PowerManager::~PowerManager()
{

}

int PowerManager::setValidAxisPositionIncre(int axisId, int incrementCommand)
{
    qDebug()<<"setValidAxisPositionIncre"<<axisId<<incrementCommand;
    currentValidAxisId=axisId;

    positionIncrement=incrementCommand;

    return 1;
}

int PowerManager::getVrepRadianToEncoder(int robID, int axis, float &radianVec)
{

}

float PowerManager::getVrepEncoderToRadian(int robID, int axis, const int &encoderVec)
{

}

int PowerManager::initialServoParameter(int robID)
{

}

int PowerManager::setMotorControlMode(int robID, int axisId, E_MOTOR_CONTROL_MODE modeIn)
{

}

int PowerManager::algorithmFunctioncall(int robID, QVector<bool> servoOnStatus, QVector<MotorData> motorFeedback,
                                        QVector<MotorData> &motorCommandOut, int &returnMutexFlag)
{
    motorCommandOut=motorFeedback;
    if(currentValidAxisId>=0&&currentValidAxisId<motorCommandOut.size())
    {
        motorCommandOut[currentValidAxisId].position+=positionIncrement;
    }
    returnMutexFlag=0;//0代表生效，负数代表本次不生效
}

int PowerManager::getMotorEncoderPulsePerRound(int robID, QVector<double> &pulseOut)
{

}
